<template>
  <section>
    <h2>Nuxt网站模板</h2>
    <p>{{ inner_title }}</p>
  </section>
</template>

<script>
import {mapGetters} from "vuex";
import axios from "axios";
export default {
  data() {
    return {
      inner_title: ''
    }
  },
  computed: {
    ...mapGetters(['config']),
  },
  async asyncData({store}){
    await store.dispatch('app/getSystemConfig')
  },
  head() {
    return {
      title: this.config.seo_name,
      meta: [
        {
          hid: 'description',
          name: 'description',
          content: this.config.desc,
        },
        {
          hid: 'keywords',
          name: 'keywords',
          content: this.config.keywords
        },
      ]
    }
  },
  mounted() {
    axios.get('https://v1.hitokoto.cn').then(res => {
      this.inner_title = res.data.hitokoto;
    })
  }
}
</script>
<style>
#nprogress .bar {
  background: rgb(50,63,166) !important;
}
.viewer-in {
  animation:dialog-in .2s
}
@keyframes dialog-in{0%{opacity:0}to{opacity:1}}
</style>
